import Request from './request.js'
let request = new Request().http

export function regUser(data) {
    return request({
        url: "/ucenter/user/regUser",
        method: 'POST',
        data: data,
        contentType: 'json'
    });
}


export function login(data) {
    return request({
        url: "/ucenter/auth/login",
        method: 'POST',
        data: data,
        contentType: 'json'
    });
};


export function bind(data) {
    return request({
        url: `/ucenter/device/bind/${data}`,
        method: 'POST',
        data: '',
        contentType: 'json'
    });
};


export function getData(data) {
    return request({
        url: `/ucenter/home/data?merchantId=${data}`,
        method: 'GET',
        data: '',
        contentType: 'json'
    });
};
export function getCombo(merchantId) {
    return request({
        url: `/ucenter/combo/info?merchantId=${merchantId}`,
        method: 'GET',
        data: '',
        contentType: 'json'
    });
};

export function bindMerchant(data) {
    return request({
        url: `/ucenter/device/combo/${data}`,
        method: 'GET',
        data: '',
        contentType: 'json'
    });
};

export function bindInfo(data) {
    return request({
        url: `/ucenter/device/combo/info/${data}`,
        method: 'GET',
        data: '',
        contentType: 'json'
    });
};



export function orderList(data) {
    return request({
        url: `/ucenter/order/list`,
        method: 'POST',
        data: data,
        contentType: 'json'
    });
};

export function updatePasswd(data) {
    return request({
        url: `/ucenter/user/updatePasswd`,
        method: 'POST',
        data: data,
        contentType: 'json'
    });
};


export function resetPasswd(data) {
    return request({
        url: `/ucenter/user/resetPasswd`,
        method: 'POST',
        data: data,
        contentType: 'json'
    });
};

export function deviceList(data) {
    return request({
        url: `/ucenter/device/list`,
        method: 'POST',
        data: data,
        contentType: 'json'
    });
};


export function deviceAdd(data) {
    return request({
        url: `/ucenter/device/add`,
        method: 'POST',
        data: data,
        contentType: 'json'
    });
};


export function setDevice(data) {
    return request({
        url: `/ucenter/device/data/${data}`,
        method: 'GET',
        data: data,
        contentType: 'json'
    });
};


export function setName(data) {
    return request({
        url: `/ucenter/device/setName`,
        method: 'POST',
        data: data,
        contentType: 'json'
    });
};

export function createOrder(data) {
    return request({
        url: `/ucenter/order/create`,
        method: 'POST',
        data: data,
        contentType: 'json'
    })
}
export function orderPay(data) {
    return request({
        url: `/ucenter/order/pay`,
        method: 'POST',
        data: data,
        contentType: 'json'
    })
}
export function getOpenid(data) {
    return request({
        url: `/ucenter/wxMp/login`,
        method: 'get',
        data: data,
        contentType: 'json'
    })
}


export function getUrl(iccId) {
    return request({
        url: `/ucenter/device/card/auth/${iccId}`,
        method: 'get',
        contentType: 'json'
    });
};

export function comboList(data) {
    return request({
        url: `/ucenter/order/combo/list`,
        method: 'POST',
        data: data,
        contentType: 'json'
    });
};


export function updateApp(data) {
    return request({
        url: `/ucenter/version/up`,
        method: 'POST',
        data: data,
        contentType: 'json'
    });
};

export function defaultStatus(data) {
    return request({
        url: `/ucenter/device/setDefaultStatus/${data}`,
        method: 'POST',
        data: data,
        contentType: 'json'
    });
};